You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added --auto-scale to adjust incoming and outgoing graph ceilings independently as traffic changes. Explicit direction limits remain fixed, and zero restores the default fixed ceiling.
Incoming and outgoing graphs default to ceilings of 10,240 kBit/s.
Documentation
Updated the quick start guide with auto-scaling behavior, clipping details, and an example using a mix of automatic and fixed ceilings.
No actionable comments were generated in the recent review.
Walkthrough
The CLI adds opt-in, independent auto-scaling for incoming and outgoing traffic, with per-direction fixed overrides. The monitor adjusts automatic ceilings from measured rates and provides current ceilings to graph views.
Changes: Traffic graph auto-scaling
Layer / File(s)
Summary
CLI scaling policy and documentation src/arguments.rs, README.md, Cargo.toml, src/application/tests.rs
The parser supports --auto-scale, independent -i and -o fixed overrides, and fixed defaults when auto-scaling is omitted. Help text, README guidance, and tests reflect the policy. The package version changes to 0.1.5.
Each direction maintains its own scale. Automatic ceilings rise to match measured rates and decrease after sustained low traffic. Direction views use the current ceiling. Tests cover scaling behavior, fixed-policy setup, and a PTY traffic burst.
sequenceDiagram
participant User
participant CLIParser
participant Monitor
participant DirectionScale
participant DirectionView
participant Terminal
User->>CLIParser: Set --auto-scale and optional -i/-o values
CLIParser->>Monitor: Pass per-direction CeilingPolicy values
Monitor->>DirectionScale: Initialize scale from policy
Monitor->>DirectionScale: Update scale from measured rate
Monitor->>DirectionView: Provide total and current ceiling
DirectionView->>Terminal: Supply graph view for display
Loading
Suggested reviewers:codewithma
Merge Risk: Minimal · up to 8c40d · assessed changes only
Path filters excluded changed files. This rating applies only to the assessed changes.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title 'feat(graphs): add opt-in traffic auto-scaling' names the main change. The PR adds an opt-in --auto-scale flag that lets incoming and outgoing graph ceilings scale independently. The title i…
Linked Issues check
Issue #1 coding requirements are met, based on the whole-PR summary for merge base 13d2464 to head 8c40d97. No repository inspection was needed. (1) Opt-in flag: src/arguments.rs accepts `--auto-scal…
Out of Scope Changes check
All changes map to the PR objectives or to supporting work. The --auto-scale option, CeilingPolicy, monitor scaling logic, and DirectionView changes implement issue #1. The README and --help updat…
Full details: Title check
Explanation
The title 'feat(graphs): add opt-in traffic auto-scaling' names the main change. The PR adds an opt-in --auto-scale flag that lets incoming and outgoing graph ceilings scale independently. The title is specific, short, and matches the linked issue and the changeset. It has no file lists, emojis, or vague terms.
Full details: Linked Issues check
Explanation
Issue #1 coding requirements are met, based on the whole-PR summary for merge base 13d2464 to head 8c40d97. No repository inspection was needed. (1) Opt-in flag: src/arguments.rs accepts --auto-scale. Without it, unspecified directions stay Fixed(DEFAULT_CEILING_BYTES). (2) Independent scaling: Ceilings holds a CeilingPolicy per direction, and src/monitor.rs scales each direction separately. (3) Rise and fall: an automatic ceiling rises to the next power of two above the measured rate at once. It halves only after the rate stays at or below one quarter of the ceiling for two seconds. This matches the issue's fast-rise and gradual-fall requirement. (4) Overrides: an explicit -i or -o fixes that direction, and the other direction can auto-scale. An explicit zero restores that direction's fixed default. (5) Display: DirectionView receives a concrete ceiling from each direction's scale. The PTY test checks the incoming and outgoing ceiling displays. (6) Docs: --help text and README were updated. (7) Tests: unit tests cover automatic scaling, per-direction and per-interface scaling, recovery, and saturation. A Linux PTY test covers the flag end to end. Residual uncertainty: the summary does not show the exact rendering of the ceiling label, and the no-jitter criterion relies on the two-second hold and halving rule.
Full details: Out of Scope Changes check
Explanation
All changes map to the PR objectives or to supporting work. The --auto-scale option, CeilingPolicy, monitor scaling logic, and DirectionView changes implement issue #1. The README and --help updates document the flag, as #1 requires. Test updates that switch fixed ceilings to CeilingPolicy::Fixed(...) in src/application/tests.rs, src/proc_sampler.rs, src/screen.rs, src/terminal/runtime/tests.rs, and src/terminal/session/tests.rs follow from the new type. The Cargo.toml version bump to 0.1.5 is listed in the PR description and is a stated change, so it is in scope by declared intent. Cargo.lock is excluded from review under the !**/*.lock rule. Its absence is not treated as evidence either way, and it does not affect this verdict. No unrelated behavior change appears in the summary.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 28b744bb-faa9-4782-b3d5-33b074581316
Commits
Reviewing files that changed from the base of the PR and between 13d2464 and 8c40d97.
Files ignored due to path filters: 1
Cargo.lock is excluded by !**/*.lock
Files selected for processing: 10
Cargo.toml
README.md
src/application/tests.rs
src/arguments.rs
src/monitor.rs
src/proc_sampler.rs
src/screen.rs
src/terminal/runtime/tests.rs
src/terminal/session/tests.rs
tests/linux_pty.rs
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Make quiet traffic visible and keep bursts from flattening against a fixed graph ceiling. Closes #1.
What changed
--auto-scalewith independent ceilings per interface and direction. Ceilings rise immediately and fall in steps after sustained low traffic.-iand-ooverrides fixed, including0for the fixed default. Document the flag in--helpand the README.0.1.5.Tradeoffs
Older spikes can clip as the ceiling drops. They no longer keep quiet traffic compressed for as long as they remain on screen.
Blast Radius
Without
--auto-scale, graph scaling stays unchanged. Traffic statistics are unaffected in either mode.Verification
cargo test --locked -- --test-threads=1cargo test --release --locked --test linux_pty -- --test-threads=1cargo fmt --checkandcargo clippy --locked --all-targets -- -D warningsnload-rs --versionreports0.1.5.Summary by CodeRabbit
--auto-scaleto adjust incoming and outgoing graph ceilings independently as traffic changes. Explicit direction limits remain fixed, and zero restores the default fixed ceiling.